package game.units;

import java.util.ArrayList;
import java.util.HashMap;

import game.enums.Alignment;
import game.enums.Size;
import game.referenceValues.DDClass;
import game.referenceValues.Feat;
import game.referenceValues.Magic;
import game.referenceValues.Race;
import game.referenceValues.Skill;

public class Character extends Unit
{

	private HashMap<String, Skill> skills;
	private ArrayList<DDClass> classes;
	private ArrayList<Feat> feats;
	
	public Character(String name, int height, int weight, String gender,
			String deity, Size size, Alignment alignment, int level,
			int expirience, int armorClass, int fortitude, int reflex,
			int will, int attackBase, ArrayList<Attribute> attributes,
			ArrayList<Magic> magics, Race race)
	{
		super(name, height, weight, gender, deity, size, alignment, level,
				expirience, armorClass, fortitude, reflex,
				will, attackBase, attributes, magics, race);
		
		this.classes = new ArrayList<DDClass>();
		this.feats = new ArrayList<Feat>();
		this.skills = Skill.generateSkillMap();
		
	}
	
	public HashMap<String, Skill> getSkills() 
	{
		return skills;
	}
	
	public void updateSkill(Skill skill) 
	{
		this.skills.remove(skill.getName());
		this.skills.put(skill.getName(), skill);
	}
	
	public ArrayList<DDClass> getClasses() 
	{
		return classes;
	}
	
	public void setClasses(ArrayList<DDClass> classes) 
	{
		this.classes = classes;
	}
	
	public void updateClass(DDClass classe, int index, boolean remove)
	{
		this.classes.remove(index);
		if(!remove)
			this.classes.add(classe);
	}
	
	public ArrayList<Feat> getFeats() 
	{
		return feats;
	}
	
	public void updateFeat(Feat feat, int index, boolean remove) 
	{
		this.feats.remove(index);
		if(!remove)
			this.feats.add(feat);
	}
	
	
	
}
